// source --> https://petitbouquetweddings.com/wp-content/themes/Angelina_Theme/js/lovely-custom-scripts.js?ver=5.6.1 /* jQuery directional hover The MIT License (MIT) Copyright (c) 2015 Alex Craig (http://acraig.ca/) */ !function(t){t.fn.directionalHover=function(e){var n=t.extend({},t.fn.directionalHover.defaults,e),o=function(t,e,n,o,f,a,r,s){var u=0;o-s<=a/2&&(u^=1),n-r>=f/2&&(u^=2),o-s>a/2&&(u^=4),n-r') }); $('.lovely-testimonial').each(function() { if( $('.et_pb_testimonial_portrait', this).length ) { portrait = $('.et_pb_testimonial_portrait', this); $('.et_pb_testimonial_author', this).before(portrait); $(this).addClass('has-portrait'); } if( $(this).hasClass('et_pb_testimonial_no_image') ) { $('.et_pb_testimonial_author', this).before(''); } }); $('.lovely-blurb1').each(function () { //loop over each list item description= $('.et_pb_blurb_content .et_pb_blurb_container .et_pb_blurb_description', this); $('.et_pb_blurb_container', this).after('
'); $('.blurb-description', this).append(description); // add blurb link on back side of the flip if( $('.et_pb_blurb_content .et_pb_module_header a', this).length ) { $(this).addClass('has_link'); if ( $('.et_pb_blurb_content .et_pb_module_header a', this).attr('target') == '_blank' ) { link_target = $(this).find('a').attr('href'); $('.et_pb_blurb_content .blurb-description', this).after("
"); } else { link_target = $(this).find('a').attr('href'); $('.et_pb_blurb_content .blurb-description', this).after("
"); } } }); $(document).bind('ready ajaxComplete', function(){ $(".more-link").text(lovely_values.lovely_readmore); if ( lovely_values.lovely_popup == 'on' ) { // open popup on click $('a[href="#open-popup"]').addClass('et_smooth_scroll_disabled'); $('a[href="#open-popup"]').magnificPopup({ type:'inline', mainClass: 'lovely-mfp', zoom: { enabled: true, // By default it's false, so don't forget to enable it duration: 2000, // duration of the effect, in milliseconds easing: 'ease-in-out', // CSS transition easing function }, callbacks: { open: function() { $('body').addClass('blurred'); }, close: function() { $('body').removeClass('blurred'); } }, prependTo: '#page-container' }); } $('.lovely-portfolio .et_pb_portfolio_item').directionalHover(); $('.lovely-gallery .et_pb_gallery_item').directionalHover(); $( 'div.lovely-portfolio' ).find( 'li.et_pb_portfolio_filter a' ).on( 'classChanged', function() { setTimeout( function() { $('.lovely-portfolio .et_pb_portfolio_item').directionalHover(); }); }); $( 'div.lovely-portfolio' ).on( 'classChanged', 'li.page a', function() { setTimeout( function() { $('.lovely-portfolio .et_pb_portfolio_item').directionalHover(); }); }); // add button class to read more & previous & next link //$('a.more-link, .pagination .alignleft a, .pagination .alignright a').addClass('et_pb_button'); //Remove pipes, commas and 'by' from the meta //Remove pipes, commas and 'by' from the meta $(".post-meta, .archive #left-area .et_pb_post, .charlize_blogalternate .post-meta").html(function () { return $(this).html().replace(/\|/g, '').replace('by', '').replace('...', '').replace(/,/g, ''); }); //Wrap text nodes in comments container and remove all but last $(".et_pb_post .post-meta").contents().filter(function () { return this.nodeType === 3; }).wrap('').end(); $('.et_pb_post .post-meta span.ds-comments:not(:last-child)').remove(); //Replace pipes and remove commas from the meta /*$(".et_pb_post .post-meta, .et_pb_post").html(function () { return $(this).html().replace(/\|/g, '/').replace(/,/g, ''); });*/ //Wrap the category in a container $('.angelina_grid_blog .et_pb_post').each(function () { $(this).find('[rel~="tag"]').wrapAll('
'); //Move the vategory above the post title $(this).find('.angelina-blog-cat').detach().insertBefore($(".entry-title", this)); }); }) // wrap blog article elements on archive pages $('.et_pb_post').contents().filter(function() { return this.nodeType == 3 && $.trim(this.nodeValue).length; }) .wrap('

'); $('.blog .et_pb_post, .archive .et_pb_post').each(function () { $('>:not(a)', this).wrapAll('

'); if ( $('.entry-featured-image-url', this).length ) { $(this).addClass('has-img'); } }); // change Select Page to Menu $('#et_mobile_nav_menu .select_page').text('Menu'); }); // equal blurbs height (function($){ function equalizeHeights(selector) { var heights = new Array(); $(selector).each(function() { $(this).css('min-height', '0'); $(this).css('max-height', 'none'); $(this).css('height', 'auto'); heights.push($(this).height()); }); var max = Math.max.apply( Math, heights ); $(selector).each(function() { $(this).css('height', max + 'px'); }); } $(window).load(function() { equalizeHeights('.lovely-equal-height-blurb .et_pb_blurb_container'); var iv = null; $(window).resize(function() { if(iv !== null) { window.clearTimeout(iv); } iv = setTimeout(function() { equalizeHeights('.lovely-equal-height-blurb .et_pb_blurb_container'); }, 120); }); }); })(jQuery); // Collapsible Mobile Menu (function($) { function setup_collapsible_submenus() { $( "" ).insertBefore( "#main-header #mobile_menu.et_mobile_menu .menu-item-has-children > a" ); $( "#main-header #mobile_menu.et_mobile_menu .sub-menu-toggle" ).click(function () { $(this).toggleClass("popped"); }); } $(document).ready(function() { setup_collapsible_submenus(); }); $(window).load(function() { setup_collapsible_submenus(); }); })(jQuery); // source --> https://petitbouquetweddings.com/wp-content/themes/Angelina_Theme/js/custom.js?ver=5.6.1 jQuery(document).ready(function($) { //Wrap the category in a container $('.oliviapro_grid .et_pb_post, .single .et_pb_post, .oliviapro_grid_blog .et_pb_post, .oliviapro_listblog .et_pb_post').each(function () { $(this).find('[rel~="tag"]').wrapAll('
'); //Move the vategory above the post title $(this).find('.oliviapro-blog-cat').detach().insertBefore($(".entry-title, .et_pb_slide_title", this)); }); $('.angelina_grid_blog .et_pb_post').each(function () { $(this).find('[rel~="tag"]').wrapAll('
'); //Move the vategory above the post title $(this).find('.angelina-blog-cat').detach().insertBefore($(".entry-title", this)); }); //Remove pipes, commas and 'by' from the meta $(".post-meta, .archive #left-area .et_pb_post, .angelina_grid_blog .post-meta, .angelina_blog .post-meta, .maggie_gridblog .post-meta, .maggie_listblog .post-meta").html(function () { return $(this).html().replace(/\|/g, '').replace('by', ''); }); // wrap blog article elements on archive pages $('.et_pb_post').contents().filter(function() { return this.nodeType == 3 && $.trim(this.nodeValue).length; }) .wrap('

'); $('.maggie_blogalternatehome .et_pb_post, .maggie_blogalternate .et_pb_post, .oliviapro_listblog .et_pb_post').each(function () { $('>:not(a.entry-featured-image-url)', this).wrapAll('

'); }); }); jQuery(document).ready(function($){ function ds_setup_collapsible_submenus() { var $menu = $('.et_mobile_menu'), top_level_link = '.et_mobile_menu .menu-item-has-children > a'; $menu.find('a').each(function() { $(this).off('click'); if ( $(this).is(top_level_link) ) { $(this).attr('href', '#'); } if ( ! $(this).siblings('.sub-menu').length ) { $(this).on('click', function(event) { $(this).parents('.mobile_nav').trigger('click'); }); } else { $(this).on('click', function(event) { event.preventDefault(); $(this).parent().toggleClass('visible'); }); } }); } $(window).load(function() { setTimeout(function() { ds_setup_collapsible_submenus(); }, 700); }); });